<?php
class doctype extends Model{

	public function insertdoctype(){
		$sql="insert into docuementtype(docuementtypecode,name,created_date,active_yn) values('{$this->db->escape($_POST["doctypecode"])}','{$this->db->escape($_POST["doctypename"])}',".
		"NOW(),'Y')";
		$this->db->query($sql);
	}

	public function checkdoctypecodeexist($doctypecode){
		$sql="select * from docuementtype where docuementtypecode='{$doctypecode}'";
		$res=$this->db->query($sql);
		return $res->num_rows;
	}
	
	public function loaddoctype(){
		$sql="select * from docuementtype where active_yn='Y'";
		 return $this->db->query($sql);
	}


}
?>